<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>22.使用setPrototypeOf替代__proto__</title>
</head>

<body>
</body>
<script>
  // 设置原型的标准方法
  let user = {
    show () {
      this.name;
    }
  };
  let hd = {name: 'houdunren'};
  Object.setPrototypeOf(hd,user);
  console.log(hd.show());
  console.log(Object.getPrototypeOf(hd));//{show: ƒ} show : ƒ show() [[Prototype]] : Object
</script>

</html>